package com.hexinfo.dmpro.monitor.controller;

import com.hexinfo.dmpro.common.annotation.AnonymousAccess;
import com.hexinfo.dmpro.common.annotation.Log;
import com.hexinfo.dmpro.monitor.service.DeleteDataService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName: DeleteDataController
 * @Description:
 * @Author: zhou
 * @Date: 2024-03-28
 */
@RestController
@RequestMapping("/api/deleteData")
public class DeleteDataController {

    @Resource
    private DeleteDataService deleteDataService;

    /**
     * 清除数据
     * timeMonth 删除多少月前的数据
     */
    @Log("清除数据")
    @GetMapping("/deleteDataMonth")
    @AnonymousAccess
    public ResponseEntity<Object> deleteDataMonth(int timeMonth) {
        return new ResponseEntity(deleteDataService.deleteDataMonth(timeMonth), HttpStatus.OK);
    }
}